
clc
clear

rand('state',0);
randn('state',0);

load Inputs/alpha

N_packets = 200;
init_noise_length = 84000;
ESNO_db = 33; %[28 30 33 35];
EsNo = 10.^(ESNO_db/10);
Rate = 9600;
modulationIndex = find(Rate == [3200 4800 6400 8000 9600])+1;
Initial_Noise = [];
init_noise_Temp = 0;

for i = 1:N_packets
    
    for SNR_Index =1:length(ESNO_db)
        
        Sigma = 1 / sqrt(EsNo(SNR_Index));
        
        init_noise(i) = round(abs(rand())*init_noise_length);
        init_noise_Temp = init_noise_Temp + init_noise(i);
        
        init_noise_indecies(i) = init_noise_Temp;

        Initial_Noise_Temp = (Sigma/alpha(modulationIndex))* ((randn(1,init_noise(i))+...
            1i*randn(1,init_noise(i)))/sqrt(2));
        
        Initial_Noise = [Initial_Noise Initial_Noise_Temp];
    end
end

init_noise_indecies = [0 init_noise_indecies];

save Inputs/Initial_Noise Initial_Noise
save Inputs/init_noise_indecies init_noise_indecies
save Inputs/init_noise init_noise





